{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src=\"https://raw.githubusercontent.com/Qiskit/qiskit-tutorials/master/images/qiskit-heading.png\" width=\"500 px\" align=\"center\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# _*Qiskit Aqua: Experiment with classification problem with quantum-enhanced support vector machines*_\n",
    "\n",
    "This notebook is based on an official notebook by Qiskit team, available at https://github.com/qiskit/qiskit-tutorial under the [Apache License 2.0](https://github.com/Qiskit/qiskit-tutorial/blob/master/LICENSE) license. \n",
    "The original notebook was developed by Vojtech Havlicek<sup>[1]</sup>, Kristan Temme<sup>[1]</sup>, Antonio Córcoles<sup>[1]</sup>, Peng Liu<sup>[1]</sup>, Richard Chen<sup>[1]</sup>, Marco Pistoia<sup>[1]</sup> and Jay Gambetta<sup>[1]</sup> (<sup>[1]</sup>IBMQ)\n",
    "\n",
    "Your **TASK** is to execute every step of this notebook while learning to use qiskit-aqua and also understanding how this SVM implementation can be used for classifying breast cancer analysis."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Introduction\n",
    "Classification algorithms and methods for machine learning are essential for pattern recognition and data mining applications. Well known techniques such as support vector machines and neural networks have blossomed over the last two decades as a result of the spectacular advances in classical hardware computational capabilities and speed. This progress in computer power made it possible to apply techniques, that were theoretically developed towards the middle of the 20th century, on classification problems that were becoming increasingly challenging.\n",
    "\n",
    "A key concept in classification methods is that of a kernel. Data cannot typically be separated by a hyperplane in its original space. A common technique used to find such a hyperplane consists on applying a non-linear transformation function to the data. This function is called a feature map, as it transforms the raw features, or measurable properties, of the phenomenon or subject under study. Classifying in this new feature space -and, as a matter of fact, also in any other space, including the raw original one- is nothing more than seeing how close data points are to each other. This is the same as computing the inner product for each pair of data in the set. So, in fact we do not need to compute the non-linear feature map for each datum, but only the inner product of each pair of data points in the new feature space. This collection of inner products is called the kernel and it is perfectly possible to have feature maps that are hard to compute but whose kernels are not.\n",
    "\n",
    "In this notebook we provide an example of a classification problem that requires a feature map for which computing the kernel is not efficient classically -this means that the required computational resources are expected to scale exponentially with the size of the problem. We show how this can be solved in a quantum processor by a direct estimation of the kernel in the feature space. The method we used falls in the category of what is called supervised learning, consisting of a training phase (where the kernel is calculated and the support vectors obtained) and a test or classification phase (where new unlabelled data is classified according to the solution found in the training phase).\n",
    "\n",
    "References and additional details:\n",
    "\n",
    "[1] Vojtech Havlicek, Antonio D. C´orcoles, Kristan Temme, Aram W. Harrow, Abhinav Kandala, Jerry M. Chow, and Jay M. Gambetta1, \"Supervised learning with quantum enhanced feature spaces,\" [arXiv: 1804.11326](https://arxiv.org/pdf/1804.11326.pdf)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from qsvm_datasets import *\n",
    "from qiskit.aqua.utils import split_dataset_to_data_and_labels, map_label_to_class_name\n",
    "from qiskit.aqua.input import get_input_instance\n",
    "from qiskit.aqua import run_algorithm\n",
    "\n",
    "# setup aqua logging\n",
    "import logging\n",
    "from qiskit.aqua._logging import set_logging_config, build_logging_config\n",
    "# set_logging_config(build_logging_config(logging.DEBUG))  # choose INFO, DEBUG to see the log"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### [Optional] Setup token to run the experiment on a real device\n",
    "If you would like to run the experiement on a real device, you need to setup your account first.\n",
    "\n",
    "Note: If you do not store your token yet, use `IBMQ.save_accounts()` to store it first."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "from qiskit import IBMQ\n",
    "IBMQ.load_accounts()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "First we prepare the dataset, which is used for training, testing and the finally prediction.\n",
    "\n",
    "*Note: You can easily switch to a different dataset, such as the Breast Cancer dataset, by replacing 'ad_hoc_data' to 'Breast_cancer' below.*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "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HdNZjvOA/BlM8s6RVUAbwZw31Y/jPMBfMHMHsxoz60A7p4I5LMA9vsWqEw2ISpGmWxCVIwauBAVowYuRMWogQtRMWrgQlSMGrgQFaMGLkTFqIELUTH/B0aFQF+h+KscAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAW4AAAEICAYAAAB/Dx7IAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAF3RJREFUeJzt3X2QXXV9x/HPx81WrzxkQVaHbILBjmaKSSTOlhlNy1BjDVaiMe2kgoLamWY6rYIPE4b4R0SmCtNMxdJaO5EHUVG7YsgIKJEBEXEU2CWYACE+UGyykWYRNoDdyhK//eOcJXc3+3Du7r33nHPv+zWzc3fPvXvzPXDvZ3/393QcEQIAlMdL8i4AAFAbghsASobgBoCSIbgBoGQIbgAoGYIbAEqG4Eah2P6A7Xumuf9Ltv+xmTUBRUNwoyls32X7adsvzbuWmaR/PA7bfi79+i/b19l+XQ3PwR8YNAzBjYazvVjSn0oKSe/MtZjsfhwRx0qaL+mtkkYkDdhemm9ZAMGN5rhA0k8kfUnS+6vvsP0K29+2/Yzt+yT9YYbnO8H2rbaftX2v7Rd/x/abbd9v+1B6++aq+05MW84H0tb/9pn+oYg4HBG/jIi/l/QDSZdWPd83bT+R/lt32359enyDpPdKujhtsd+cHr/E9i/Tuh+x/e4M5wocheBGM1wg6Yb0a7XtV1Xd93lJ/yfpZEl/k37N5FxJn5J0gqRfSPq0lASzpFslXSXpFZI+K+lW269If+8rkl4u6fWSXinpyhrPY5uSTw5jvivptelzPZCenyJia/r9P0XEsRGxJn38L9Pfn5/W/1XbJ9dYA0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ulCH3c6UZWP5P050oW/Nwv6dyIeCTXwmpk+0xJz0n6ckQszbue2bB9sqSTI+IB28dJGpC0toT/LyzpmIh4znanpHskXRQRP8m5tJrZ/pikXknHR8Q5edczG7Yfl9QbEaVdgGP7ekk/jIirbf+BpJdHxHAetRSlxd0SG1lFxN2Snsq7jrmIiF9HxAPp989K2qNJ9qYpukg8l/7YmX7l30qpke2Fkt4h6eq8a2lnto+XdKakayQpIp7PK7Sl4gR3po2s0Fy2F0taIenefCuZnbSL4UFJByXdHhFlPI/PSbpY0u/zLmSOQtL3bA/Y3pB3MbPwGklDkq5Lu62utn1MXsUUJbgzbWSF5rF9rKRvSfpIRDyTdz2zERGHI+J0JfvrnGG7VN1Xts+RdDAiBvKupQ5WRsQblezr/w9pt2KZzJP0RklfiIgVkn4rKbexuKIEd80bWaFx0j7hb0m6ISK25V3PXKUfae+SdHbOpdRqpaR3pv3D35D0Fttfzbek2YmIA+ntQUk3KekeLZP9kvZXfWq7UUmQ56IowX2/pNfaPjXt9H+PpG/nXFNbSgf1rpG0JyI+m3c9s2W723ZX+n1F0lslPZpvVbWJiE0RsTAiFit5T9wZEe/Luaya2T4mHehW2r3wNkmlmnkVEU9I2md7SXpolaTcBuwz7VXSaK2ykZXtr0s6S9JJtvdL+mREXJNvVTVbKel8SbvT/mFJ+kS6X02ZnCzp+nTG0ksk9UVEaafTldyrJN2UtAk0T9LXIuK2fEualQ9LuiFtXD4m6YN5FVKI6YAAgOyK0lUCAMiI4AaAkiG4AaBkCG4AKBmCGwBKhuAGgJIhuAGgZP4fa2w2P8qJYkwAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'A': 0, 'B': 1}\n"
     ]
    }
   ],
   "source": [
    "feature_dim=2 # we support feature_dim 2 or 3\n",
    "sample_Total, training_input, test_input, class_labels = ad_hoc_data(\n",
    "    training_size=20, test_size=10, n=feature_dim, gap=0.3, PLOT_DATA=True\n",
    ")\n",
    "\n",
    "datapoints, class_to_label = split_dataset_to_data_and_labels(test_input)\n",
    "print(class_to_label)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "With the dataset ready we initialize the necessary inputs for the algorithm:\n",
    "- the input dictionary (params) \n",
    "- the input object containing the dataset info (algo_input)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "params = {\n",
    "    'problem': {'name': 'classification', 'random_seed': 10598},\n",
    "    'algorithm': {\n",
    "        'name': 'QSVM'\n",
    "    },\n",
    "    'backend': {'name': 'qasm_simulator', 'shots': 1024},\n",
    "    'feature_map': {'name': 'SecondOrderExpansion', 'depth': 2, 'entanglement': 'linear'}\n",
    "}\n",
    "\n",
    "algo_input = get_input_instance('ClassificationInput')\n",
    "algo_input.training_dataset  = training_input\n",
    "algo_input.test_dataset = test_input\n",
    "algo_input.datapoints = datapoints[0] # 0 is data, 1 is labels"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "With everything setup, we can now run the algorithm.\n",
    "\n",
    "For the testing, the result includes the details and the success ratio.\n",
    "\n",
    "For the prediction, the result includes the predicted labels. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "testing success ratio:  1.0\n",
      "predicted classes: ['A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B']\n"
     ]
    }
   ],
   "source": [
    "result = run_algorithm(params, algo_input)\n",
    "print(\"testing success ratio: \", result['testing_accuracy'])\n",
    "print(\"predicted classes:\", result['predicted_classes'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "kernel matrix during the training:\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAP8AAAD8CAYAAAC4nHJkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJztnXl4VfX17t+VOYEEkgAhJECYZAqSyGC0VAFBkaLRKqJW6/Rcrba/ap2q3g5W2vvrzwG11w5qRdCiAuKAFC0zFBFknkQGIYSQhCkECYGEJN/7R056OVnvlkjgQNzr8zw8yXlZ+5x99jkr+5y11/dd4pyDYRj+I+xs74BhGGcHS37D8CmW/IbhUyz5DcOnWPIbhk+x5DcMn2LJbxg+xZLfMHxKo5JfREaIyGYR2SYij52unTIM48wjp9rhJyLhALYAGA6gAMByADc55774hm3Ug3Xo0o3GRkdHKi0yPNzrfpWWv6OAxqZnpCktNlI/FgCUlpcrLSE2VmnVNTV0e7a/ew4cpLFtkhOVVnK4jMbGRkcpLS46msbqIwPkF+yhsUmtWigthhybsooKun3LuDilVVZV0djIiAilVVVX09jwMH2O8opl93uc7AN7zwBABHms8spKGhsbpV+H4177Rd4LYR77wI5Zpcf9Nq/3uufl5WH//v38juuhj1TDGQhgm3NuOwCIyDsAcgF4Jj/j8XF/onqXzulKa5OQQGPZG/S+Wx6lsc+N/73SerZrR2M/Wr1aaZf36aO0Q+SPBACktNDJNG7CuzT257deq7S3Fyymsb26dFRa/06daCx7gz3w+PM09sa7rlJat7YpSlu67Su6/ajsbKXl799PY9OSkpS27+uvaWw8+YNbeuQIjW3bsqXSCg/qP7heJ5Lk5s2VtjY/n8b2Ttcnkr0ez6FVvH7vxsfE0Ni8ffuUVlhaSmNzunYNuj1wwAAax2jMx/40ALtOuF0Q0AzDaAI05szPPlqoj/UicjeAuxvxOIZhnAEak/wFANqfcDsdQGH9IOfcKwBeAfh3fs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ApgY+H0iaseXNymcc0XOuVWB3w8D2AQgDU38ublaygI3IwP/HIChAOrmize553WqhDr50wCcuHa1IKB9l0hxzhUBtUkEgA9sbyKISAZqpzQvw3fguYlIuIisAbAXwGwAXwEodc5VBUK+i+9JSqiTny2yt8sN5ygi0hzANAAPOOe0wUITxDlX7ZzLApCO2k+ieuaWT96ToU7+AgDtT7idDoA7ODRd9ohIKgAEfu49y/tzSohIJGoTf5Jz7r2A/J14bgDgnCsFsAC1NY2WIlLnkPJdfE9SQp38ywF0C1RXowDcCEAbwzdtpgO4LfD7bQA+PIv7ckpIrQ3SawA2OefGnfBfTfq5iUhrEWkZ+D0WwDDU1jPmA7g+ENbkntepEvImHxEZCeAFAOEAxjvn/hDSHTiNiMjbAAajdlXYHgC/BfABgCkAOgDIBzDaOccnapyjiMggAP8GsB5A3aSUJ1D7vb/JPjcROR+1Bb1w1J74pjjnnhKRzqgtPicBWA3gFuecntjyHcM6/AzDp1iHn2H4FEt+w/AplvyG4VMs+Q3Dp1jyG4ZPseQ3DJ9iyW8YPsWS3zB8yv8DpSvMK75QJgYAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "print(\"kernel matrix during the training:\")\n",
    "kernel_matrix = result['kernel_matrix_training']\n",
    "img = plt.imshow(np.asmatrix(kernel_matrix),interpolation='nearest',origin='upper',cmap='bone_r')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### The breast cancer dataset\n",
    "Now we run our algorithm with the real-world dataset: the breast cancer dataset, we use the first two principal components as features."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX8AAAEICAYAAAC3Y/QeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29m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ZaPgR8Lvb2+H+GLOH/EPh4HuJK988BNgKbgC8A0/MSW1n5C+nMaJ9G3ss/AHYDd5X9ndymePY7loEryJIWZIMIvgLcB3wPeF67X6MG47o5fUZLr8/qPMRVUfZWOjDap8HXS8DHU27YBLypE3FV+/PlHczMCmgyN/uYmdkEOfmbmRWQk7+ZWQE5+ZuZFZCTv5lZATn5m5kVkJO/mVkB/X870a/jZks+DgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'A': 0, 'B': 1} {0: 'A', 1: 'B'}\n"
     ]
    }
   ],
   "source": [
    "sample_Total, training_input, test_input, class_labels = Breast_cancer(\n",
    "    training_size=20, test_size=10, n=2, PLOT_DATA=True\n",
    ")\n",
    "# n =2 is the dimension of each data point\n",
    "\n",
    "datapoints, class_to_label = split_dataset_to_data_and_labels(test_input)\n",
    "label_to_class = {label:class_name for class_name, label in class_to_label.items()}\n",
    "print(class_to_label, label_to_class)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "testing success ratio:  0.95\n",
      "ground truth: ['A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B']\n",
      "predicted:    ['A', 'B', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B']\n"
     ]
    }
   ],
   "source": [
    "algo_input = get_input_instance('ClassificationInput')\n",
    "algo_input.training_dataset  = training_input\n",
    "algo_input.test_dataset = test_input\n",
    "algo_input.datapoints = datapoints[0]\n",
    "result = run_algorithm(params, algo_input)\n",
    "print(\"testing success ratio: \", result['testing_accuracy'])\n",
    "print(\"ground truth: {}\".format(map_label_to_class_name(datapoints[1], label_to_class)))\n",
    "print(\"predicted:    {}\".format(result['predicted_classes']))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "kernel matrix during the training:\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAP8AAAD8CAYAAAC4nHJkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJztnXl4FfX1xt9vQjYSIAl7QiCsASUYQBZBKIuoLO4iiLZoqVYrlbq0VVt/FK2t1rVaW7VuVFGgkU1cEAVBVIgsIUDCFgghJJAAIfue7++PXPpwc96BQCAQ53yexwfu65l7ZyZzmNwz5/seY62Foijuw+d874CiKOcHTX5FcSma/IriUjT5FcWlaPIrikvR5FcUl6LJryguRZNfUVxKvZLfGHO1MWaHMWa3MeaRs7VTiqKce8yZdvgZY3wB7AQwBkAGgB8A3GqtTT7JNuLDAgKa0tjgkOZCa9O+FY3NTD8otMDgIBpblJ8vtPA2/H39AvyEVl5WIbTi/CK6fYtWLYRmjKGxTM87nFfn2IqKShobEOQvtJLCYhrbpIk83oDgQKHZan7NsGvJ6fqqqqySn+/ny9+XfN7pXLbslPsFyPMCAGUlZULz8eE/M3ZsTj/fspJyoQWScwvwc+N0Hmt/XkF+LkpLivhO1KJJXYIcGAhgt7V2j2cn5gK4DoBj8jOionpRfdDQq4X26z/eQWNn3f+s0GL6X0Rj1365UmiTZ9xJY9tFtxVa5p4soa1ftp5uP+6ucUILdLjofMhF88k7n9NYP3/5Y8vJOExjO8d2FlrStxtpbMs28nh7DOghtIpS+Q8gAFSWS72inP+jxP5hC28XTmMryPtWOrwvw7eJ/EclsnskjU1NTBWaU5Ky/fInNwwA2Lt1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lx951cU5fyiv/Yriktp8OQ3xlxtjNlhjNltjHmkoT//bGKMedsYk22M2XqCFm6MWW6M2eX5kzdwX8AYY6KMMSuNMSnGmG3GmBkevVEfmzEm0BiTYIzZ7DmuWR69szFmnee45hlj+MKBHxkNmvyeYZ+vAhgL4CIAtxpjLmrIfTjLvAvg6lraIwC+stZ2B/CV53VjoxLAQ9baXgAGA7jP83Nq7MdWBmCUtfYSAHEArjbGDAbwDIAXPceVC2DaedzHBqOh7/wDAey21u6x1pYDmAvgugbeh7OGtXY1gNpL/64DcHwp3GzUjC9vVFhrs6y1Gz1/LwCQAiASjfzYbA3Hzf/8PP9ZAKMAxHv0RndcZ0pDJ38kgP0nvM7waD8m2lprs4CaJALQ5jzvT70wxkSjZkrzOvwIjs0Y42uMSQSQDWA5gFQAx6y1x51Zf4zXJKWhk5+tM9bHDRcoxpgQAB8B+I21ls9Ka2RYa6ustXEAOqDmN1E5y8sl12RDJ38GgBMH0HUAkNnA+3CuOWSMaQ8Anj+5E8QFjjHGDzWJP8dau8Aj/yiODQCstccAfI2amkaoMea4p/uP8ZqkNHTy/wCgu6e66g9gMoAlDbwP55olAKZ6/j4VwOLzuC9nhKmx2XkLQIq19oUT/lejPjZjTGtjTKjn70EArkBNPWMlgJs9YY3uuM6UBm/yMcaMA/ASAF8Ab1trn2rQHTiLGGM+BDACNavCDgGYCWARgPkAOgJIBzDRWiv9wC5gjDGXA/gGwBYAx6dNPIaa7/2N9tiMMX1QU9DzRc2Nb7619gljTBfUFJ/DAWwCcLu1lo8M/hGhHX6K4lK0w09RXIomv6K4FE1+RXEpmvyK4lI0+RXFpWjyK4pL0eRXFJeiya8oLuX/AYBIBVDfVG/XAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "print(\"kernel matrix during the training:\")\n",
    "kernel_matrix = result['kernel_matrix_training']\n",
    "img = plt.imshow(np.asmatrix(kernel_matrix),interpolation='nearest',origin='upper',cmap='bone_r')\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
